package com.socialuni.api.talk.query;

import com.socialuni.api.talk.query.home.SocialQueryHomeTalksQO;
import com.socialuni.api.talk.query.model.UniTalkRO;
import com.socialuni.api.model.ResultRO;
import com.sun.istack.internal.NotNull;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.validation.Valid;
import java.util.List;

@RequestMapping("talk")
@FeignClient(name = "talk", url = "${social.server-url:https://api.socialuni.com}")
public interface QueryTalkAPI {
    @GetMapping("queryTalks")
    ResultRO<List<UniTalkRO>> queryTalks();

    @PostMapping("queryTalks")
    ResultRO<List<UniTalkRO>> queryTalks(@RequestBody @Valid @NotNull SocialQueryHomeTalksQO queryVO);
}